from django.db import models

# Create your models here.

from django.db import models
from django.contrib.auth.models import User

class School(models.Model):
    name = models.CharField(max_length=100)

class Class(models.Model):
    name = models.CharField(max_length=100)
    school = models.ForeignKey(School, related_name='classes', on_delete=models.CASCADE)

class Student(models.Model):
    name = models.CharField(max_length=100)
    age = models.IntegerField()
    class_enrolled = models.ForeignKey(Class, related_name='students', on_delete=models.CASCADE)
    info_file = models.FileField(upload_to='uploads/', null=True, blank=True)

class FileUpload(models.Model):
    file = models.FileField(upload_to='uploads/')
